import 'package:word_game/engine/core.dart';
import 'package:word_game/task/task_manager.dart';
import 'task.dart';

class TaskableNPC extends NPC {
  List<Task> tasks = [];
  Map<String, String> taskStates = {};

  TaskableNPC(Map map) : super(map) {
    for (var taskCode in map['taskCodes']) {
      Task task = TaskManager.instance.taskWithCode(taskCode);
      if (task==null) {
        continue;
      }
      task.owner = this;
      add(task);
    }
  }
}